package com.traffic.fuwu.util;





public class Page {

	//当前页
	private int pageIndex;
	
	//总页数
	private int totalPage;
	
	//页面条数
	private int pageSize;
	
	//总数量
	private int totalCount;

	public int getPageIndex() {
		return this.pageIndex;
	}

	//页面下标小于1时值为1
	public void setPageIndex(int pageIndex) {
		if(pageIndex<1){
			pageIndex = 1;
		}
		this.pageIndex = pageIndex;
	}

	public int getTotalPage() {
		return totalPage;
	}

	public void setTotalPage() {
		this.totalPage = this.totalCount%this.pageSize==0?this.totalCount/this.pageSize:(this.totalCount/this.pageSize+1);
	}

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	public int getTotalCount() {
		return totalCount;
	}

	public void setTotalCount(int totalCount) {
		this.totalCount = totalCount;
	}
	
	public int startRow(){
		return (this.pageIndex-1)*this.pageSize;
	}
	
}
